import os
import zipfile

from core.setting import BASEPATH,ZIPFILEPATH,ZIPSAVEDIR

file_path = BASEPATH + os.path.normpath(ZIPFILEPATH)
save_path = BASEPATH + os.path.normpath(ZIPSAVEDIR)

def unzipFile(file_path:str=file_path,save_path:str=save_path):
    if not os.path.exists(save_path + r'\steamcmd.exe'):
        # 读取压缩文件
        file = zipfile.ZipFile(file_path)
        # 提取(解压)文件
        file.extractall(save_path)
        # 关闭文件流
        file.close()
